package com.lzw.breezeNovel.webApp.controller.comic;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.model.entity.query.PaginationResultQuery;
import com.lzw.breezeNovel.webApp.service.comic.ComicChapterService;
import com.lzw.breezeNovel.webApp.vo.comic.ComicChapterVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller.comic
 * @date 2025/3/16
 * @description 漫画的章节
 */
@RestController
@SuppressWarnings("all")
@RequestMapping("/app/comic/chapter")
public class ComicChapterController {

    /**
     * 注入Service
     */
    @Autowired
    private ComicChapterService comicChapterService;

    /**
     * 分页查询小说章节
     */
    @RequestMapping("/list")
    public Result<PaginationResultQuery<ComicChapterVo>> list(@RequestParam Long comicId, @RequestParam Integer pageNo, @RequestParam Integer size) {
        PaginationResultQuery<ComicChapterVo> comicChapterVoPaginationResultQuery = comicChapterService.list(comicId, pageNo, size);
        return Result.ok(comicChapterVoPaginationResultQuery);
    }

}
